<template>
    <div class="go-back">
        <button @click="jumpTo">
            <!-- 跳转首页 -->
            <van-icon name="arrow-left" />
        </button>
    </div>
</template>

<script>
export default {
    // 自定义属性接收父组件传递的值
    props: {
        url: {
            type: String,
            default: '/index'
        }
    },
    methods: {
        jumpTo() {
            this.$router.push({ path: this.url });
        }
    }
}

</script>

<style lang="less">
.go-back {
    width: 40px;
    height: 40px;

    button {
        background-color: transparent;
        width: 40px;
        height: 40px; // border: 1px solid #ccc;
        border-radius: 10px;
        color: #080808;
    }
}
</style>